﻿#parse("partials/headerpopup.html")
<script type="text/javascript">
    $(document).ready(function () {
        ///Search Specialist
        var oTableSubSpecialist = $('#datalistsubspecialist').dataTable({
            "bSort": false,
            "sPaginationType": "full_numbers",
            "bProcessing": true,
            "bServerSide": true,
            "bFilter": false,
            "sAjaxSource": "tablelistsubspecialist",
            "aoColumns": [
                            { "mDataProp": "SubSpecialistId" },
                            { "mDataProp": "SubSpecialist" },
                            { "mDataProp": "Specialist" },
                            { "mDataProp": "GroupSpecialist" }
                            

                        ],
            "aoColumnDefs": [
                                {
                                    "fnRender": function (o) {
                                        return "<center><a class='SelectedSubSpecialist' title='Select Sub Specialist' href='javascript:void(0)' SubSpecialistId='" + o.aData['SubSpecialistId'] + "' SubSpecialist='" + o.aData['SubSpecialist'] + "' Specialist='" + o.aData['Specialist'] + "' GroupSpecialist='" + o.aData['GroupSpecialist'] + "' ><img src='/images/Icons/table.png'/></a> </center>";
                                    },
                                    "aTargets": [0]
                                }
                        ],
            "fnServerData": function (sSource, aoData, fnCallback) {
                aoData.push({ "name": "DialogTextBoxSubSpecialist", "value": $('#DialogTextBoxSubSpecialist').val() });
                aoData.push({ "name": "DialogTextBoxSpecialist", "value": $('#DialogTextBoxSpecialist').val() });
                aoData.push({ "name": "DialogTextBoxGroupSpecialist", "value": $('#DialogTextBoxGroupSpecialist').val() });
                var idSpecialist = jQuery("#HusId").val();
                jQuery.ajax({
                    "dataType": 'json',
                    "type": "GET",
                    "url": "tablelistsubspecialist",
                    "data": aoData,
                    "success": fnCallback
                });
            }
        });

        function checkForEnterSubSpecialist(event) {
            if (event.keyCode == 13) {
                oTableSubSpecialist.fnDraw();
            }
        }
        $('#DialogTextBoxSubSpecialist').keypress(checkForEnterSubSpecialist);
        $('#DialogTextBoxSpecialist').keypress(checkForEnterSubSpecialist);
        $('#DialogTextBoxGroupSpecialist').keypress(checkForEnterSubSpecialist);
        $('#DialogBtnSearchSubSpecialist').click(function () { oTableSubSpecialist.fnDraw(); });

        //Add event click on list Area
        var DetailSpecialist =
    $(".SelectedSubSpecialist").live('click', function (event) {
        var SubSpecialistId = $(this).attr("SubSpecialistId");
        var SubSpecialistName = $(this).attr("SubSpecialistName");
        var SpecialistId = $(this).attr("SpecialistId");
        var SpecialistName = $(this).attr("SpecialistName");
        var GroupSpecialistId = $(this).attr("GroupSpecialistId");
        var GroupSpecialistName = $(this).attr("GroupSpecialistName");
        
        parent.setSubSpecialistTextBox(SubSpecialistId, SubSpecialistName, SpecialistId, SpecialistName, GroupSpecialistId, GroupSpecialistName);

    });
    });
</script>
<style>
    div#datalistarea_filter
    {
        display: none;
    }
    div#datalistarea_length
    {
        display: none;
    }
    .mws-table thead
    {
        margin-top: -10px;
    }
</style>
<div class="mws-form" action="#">
    <div class="mws-form-inline">
        
        <div class="mws-form-row">
            <label>
                Sub Specialist</label>
            <div class="mws-form-item small">
                <input id="DialogTextBoxSubSpecialist" type="text" value="" class="mws-textinput" />
            </div>
        </div>
        <div class="mws-form-row">
            <label>
                Specialist</label>
            <div class="mws-form-item small">
                <input id="DialogTextBoxSpecialist" type="text" value="" class="mws-textinput" />
            </div>
        </div>
        <div class="mws-form-row">
            <label>
                Group Specialist</label>
            <div class="mws-form-item small">
                <input id="DialogTextBoxGroupSpecialist" type="text" value="" class="mws-textinput" />
            </div>
        </div>
    </div>
    <div class="mws-button-row">
        <input id="DialogBtnSearchSubSpecialist" class="mws-button red" type="submit" value="Search" />
    </div>
    <div class="mws-form-row" style="padding-top: 10px">
        <table cellpadding="0" cellspacing="0" border="0" class="fullwidth mws-table" id="datalistsubspecialist"
            width="80%">
            <thead>
                <tr>
                    <th style="width: 10px; text-align: center">
                        Actions
                    </th>
                    <th style="width: 20px; text-align: center">
                        Sub Specialist Id
                    </th>
                    <th style="text-align: center">
                        Sub Specialist
                    </th>
                    <th style="text-align: center">
                        Specialist
                    </th>
                    <th style="width: 200px; text-align: center">
                        Group Specialist
                    </th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td colspan="7" class="dataTables_empty">
                        <!-- <img src="${rooturl}Images/Custom/252.gif" />-->
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
</div>
#parse("partials/footerpopup.html")
